package com.weilele.mvvmlib.sample

import com.weilele.mvvm.utils.activity.onClick
import com.weilele.mvvm.utils.vLaout.VLayoutHolder
import com.weilele.mvvmlib.databinding.HolderHomeBinding


class HomeHolder(binding: HolderHomeBinding) : VLayoutHolder<Pair<String, Function0<Unit>>, HolderHomeBinding>(binding) {

    init {
        itemView.onClick {
            bindData?.second?.invoke()
        }
    }

    override fun bindData(data: Pair<String, Function0<Unit>>) {
        mBinding.root.text = data.first
    }
}